package com.zhku.shoppingspringboot.common;

import io.swagger.annotations.ApiModel;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * 作者：zjy
 * 时间：2024/8/2 12:50
 * 描述:无bug
 */

@Getter//自动生成get方法
@ApiModel("返回结果编码")

public  enum ResultCode implements Serializable {

    SUCCESS(0, "操作成功"),

    NOT_NULL(1001, "主键不能为空"),

    VALIDATE_FAILED(1002, "数据格式错误"),

    NO_LOGIN(1003,"NO LOGIN"),

    NO_EXIST(1004,"数据不存在"),

    HAS_EXIST(1005,"数据已经存在"),

    FORBIT_USE(1006,"状态异常"),

    PERMISSION_DENIED(1007,"权限不足"),


    ERROR(1099, "操作失败");




    private int code;

    @Setter
    private String defauleMessage;

    ResultCode(int code, String defauleMessage) {
        this.code = code;
        this.defauleMessage = defauleMessage;
    }

}


